<div>
    <h2 id="page-heading">
        <span jhiTranslate="server181102App.userFans.home.title">User Fans</span>

        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-user-fans" [routerLink]="['/user-fans/new']">
            <fa-icon icon="plus"></fa-icon>
            <span  jhiTranslate="server181102App.userFans.home.createLabel">
            Create a new User Fans
            </span>
        </button>
    </h2>

    <jhi-alert-error></jhi-alert-error>

    <jhi-alert></jhi-alert>

    <div class="alert alert-warning" id="no-result" *ngIf="userFans?.length === 0">
        <span jhiTranslate="server181102App.userFans.home.notFound">No userFans found</span>
    </div>

    <div class="table-responsive" id="entities" *ngIf="userFans && userFans.length > 0">
        <table class="table table-striped" aria-describedby="page-heading">
            <thead>
                <tr jhiSort [(predicate)]="predicate" [(ascending)]="ascending" [callback]="loadPage.bind(this)">
                    <th scope="col"  jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"  jhiSortBy="fansTime"><span jhiTranslate="server181102App.userFans.fansTime">Fans Time</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"  jhiSortBy="fansFrom.id"><span jhiTranslate="server181102App.userFans.fansFrom">Fans From</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"  jhiSortBy="fansTo.id"><span jhiTranslate="server181102App.userFans.fansTo">Fans To</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"></th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let userFans of userFans ;trackBy: trackId">
                    <td><a [routerLink]="['/user-fans', userFans.id, 'view']">{{ userFans.id }}</a></td>
                    <td>{{ userFans.fansTime | date:'medium' }}</td>
                    <td>
                        <div *ngIf="userFans.fansFrom">
                            <a [routerLink]="['/user-account', userFans.fansFrom?.id, 'view']" >{{ userFans.fansFrom?.id }}</a>
                        </div>
                    </td>
                    <td>
                        <div *ngIf="userFans.fansTo">
                            <a [routerLink]="['/user-account', userFans.fansTo?.id, 'view']" >{{ userFans.fansTo?.id }}</a>
                        </div>
                    </td>
                    <td class="text-right">
                        <div class="btn-group">
                            <button type="submit"
                                    [routerLink]="['/user-fans', userFans.id, 'view']"
                                    class="btn btn-info btn-sm">
                                <fa-icon icon="eye"></fa-icon>
                                <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
                            </button>

                            <button type="submit"
                                    [routerLink]="['/user-fans', userFans.id, 'edit']"
                                    class="btn btn-primary btn-sm">
                                <fa-icon icon="pencil-alt"></fa-icon>
                                <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
                            </button>

                            <button type="submit" (click)="delete(userFans)"
                                    class="btn btn-danger btn-sm">
                                <fa-icon icon="times"></fa-icon>
                                <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
                            </button>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

    <div *ngIf="userFans && userFans.length > 0">
        <div class="row justify-content-center">
            <jhi-item-count [page]="page" [total]="totalItems" [itemsPerPage]="itemsPerPage"></jhi-item-count>
        </div>

        <div class="row justify-content-center">
            <ngb-pagination [collectionSize]="totalItems" [(page)]="ngbPaginationPage" [pageSize]="itemsPerPage" [maxSize]="5" [rotate]="true" [boundaryLinks]="true" (pageChange)="loadPage($event)"></ngb-pagination>
        </div>
    </div>
</div>
